/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.bayu.services.dao;

import com.bayu.services.entity.GraphSm60;
/**
 *
 * @author joep
 */
import java.util.List;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Repository("graphSm60Dao")
@Transactional
public class GraphSm60Dao extends AbstractDao{
    
public List<GraphSm60> getAll(String query) {
        return hibernateTemplate.find(query);
    }

    @Override
    public List<GraphSm60> getAllByDate(String start, String end) {
        return hibernateTemplate.find("from GraphSm60 where date between '"
            + start + "' and '" + end + "' order by date asc");
    }

    @Override
    public List<GraphSm60> getById(Long id) {
        return hibernateTemplate.find("from GraphSm60 where id=" + id);
    }

    @Override
    public List<GraphSm60> getAllByMonth(String month) {
        return hibernateTemplate.find("from GraphSm60 where MONTH(date)='"
            + month + "' order by date asc");
    }

    @Override
    public double getMax() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public double getMin() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

}
